home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / SystemLogging.p < prev    next >
Text File  |  1996-05-01  |  5KB  |  193 lines

  1. {
  2.      File:        SystemLogging.p
  3.  
  4.      Contains:    System Logging Service
  5.  
  6.      Version:    Technology:    1.0
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT SystemLogging;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SYSTEMLOGGING__}
  28. {$SETC __SYSTEMLOGGING__ := 1}
  29.  
  30. {$I+}
  31. {$SETC SystemLoggingIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __TEXTOBJECTS__}
  38. {$I TextObjects.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __TIMEOBJECTS__}
  41. {$I TimeObjects.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __AEDATAMODEL__}
  44. {$I AEDataModel.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  52. {$IFC FOR_PTR_BASED_AE }
  53. {  Service types  }
  54.  
  55. TYPE
  56.     LogID                                = UInt32;
  57.     LogIterator                            = UInt32;
  58. {  Situation Types  }
  59.     LogSituationType                    = UInt32;
  60.  
  61. CONST
  62.     kLogTypeInformation            = 'info';
  63.     kLogTypeWarning                = 'warn';
  64.     kLogTypeFatal                = 'fatl';
  65.     kLogTypeSystemFatal            = 'sysf';
  66.     kLogTypeAll                    = '****';
  67.  
  68. {  System Logging Areas  }
  69.  
  70. TYPE
  71.     LogArea                                = UInt32;
  72.  
  73. CONST
  74.     kLogAreaIO                    = 'io  ';
  75.     kLogAreaNetworking            = 'netw';
  76.     kLogAreaKernel                = 'kern';
  77.     kLogAreaApplication            = 'appl';
  78.     kLogAreaBoot                = 'boot';
  79.     kLogAreaPrinting            = 'prnt';
  80.     kLogAreaCommunication        = 'comm';
  81.     kLogAreaServer                = 'serv';
  82.     kLogAreaAll                    = '****';
  83.  
  84. {  Service Version  }
  85.  
  86. TYPE
  87.     LogVersion                            = UInt32;
  88.  
  89. CONST
  90.     kLogVersion1                = 1;
  91.     kLogCurrentVersion            = 1;
  92.  
  93. {  Log Message Versions  }
  94.  
  95. TYPE
  96.     LogMsgVersion                        = UInt32;
  97.  
  98. CONST
  99.     kLogMsgVersion1                = 1;
  100.     kLogCurrentMsgVersion        = 1;
  101.  
  102. {  Message Flags  }
  103.  
  104. TYPE
  105.     LogMsgFlags                            = UInt32;
  106.  
  107. CONST
  108.     kLogMsgFlagsDataTruncated    = $00000001;
  109.     kLogMsgFlagsReceivedCorrupted = $00000002;
  110.     kLogMsgFlagsTimeInUptime    = $00000004;
  111.     kLogMsgFlagsNotified        = $00000008;
  112.  
  113.  
  114. TYPE
  115.     LogMessagePtr = ^LogMessage;
  116.     LogMessage = RECORD
  117.         msgSize:                ByteCount;
  118.         msgVersion:                LogMsgVersion;
  119.         msgFlags:                LogMsgFlags;
  120.         msgSituationType:        LogSituationType;
  121.         msgRepeatedCount:        UInt32;
  122.         msgArea:                LogArea;
  123.         msgClient:                OSType;
  124.         msgTimestamp:            TimeObject;
  125.         msgDataCount:            ByteCount;
  126.         msgStatus:                OSStatus;
  127.         msgTextSize:            ByteCount;
  128.     END;
  129.  
  130.  
  131. CONST
  132.     kLogMaxMessageSize            = 1024;
  133.  
  134.  
  135. TYPE
  136.     LogStatisticsVersion                = UInt32;
  137.  
  138. CONST
  139.     kLogStatisticsVersion1        = 1;
  140.     kLogStatisticsCurrentVersion = 1;
  141.  
  142. {  System Logging Statistics  }
  143.  
  144. TYPE
  145.     LogStatisticsPtr = ^LogStatistics;
  146.     LogStatistics = RECORD
  147.         statsVersion:            LogStatisticsVersion;
  148.         situationMsgsDropped:    UInt32;
  149.         situationMsgsTruncated:    UInt32;
  150.         situationMsgsLoggedThisSession: UInt32;
  151.         situationMsgsCurrentlyInTheLog: UInt32;
  152.         situationMsgsNotified:    UInt32;
  153.         pluginsInstalled:        UInt32;
  154.     END;
  155.  
  156. {  Variables and constants for use in the System Notication Service  }
  157.  
  158. CONST
  159.     kSystemLoggingService        = 'slss';
  160.     kLogSNSMsgKind                = 'slsm';
  161.     kLogSNSMsgSubjectSize        = 12;
  162.  
  163. {  Basic Logging routine  }
  164. FUNCTION LogSituation(situationType: LogSituationType; situationArea: LogArea; situationClient: OSType; situationText: TextObject; situationStatus: OSStatus; situationData: AEStream): OSStatus; C;
  165. {  System Logging Service Administration APIs  }
  166. FUNCTION LogOpen(VAR theService: LogID; clientName: TextObject): OSStatus; C;
  167. FUNCTION LogClose(theService: LogID): OSStatus; C;
  168. FUNCTION LogGetClientName(clientName: TextObject): OSStatus; C;
  169. FUNCTION LogClear(theService: LogID): OSStatus; C;
  170. FUNCTION LogFlush(theService: LogID): OSStatus; C;
  171. FUNCTION LogGetCommAreaSize(theService: LogID; VAR size: ByteCount): OSStatus; C;
  172. FUNCTION LogSetCommAreaSize(theService: LogID; size: ByteCount): OSStatus; C;
  173. FUNCTION LogCreateIterator(theService: LogID; VAR iterator: LogIterator): OSStatus; C;
  174. FUNCTION LogGetEntry(iterator: LogIterator; version: LogMsgVersion; VAR msg: LogMessage): OSStatus; C;
  175. FUNCTION LogDisposeIterator(iterator: LogIterator): OSStatus; C;
  176. FUNCTION LogExtractText(VAR entry: LogMessage; text: TextObject): OSStatus; C;
  177. FUNCTION LogExtractAEDesc(VAR entry: LogMessage; VAR desc: AEDesc): OSStatus; C;
  178. FUNCTION LogGetStatistics(theService: LogID; version: LogStatisticsVersion; VAR statistics: LogStatistics): OSStatus; C;
  179. FUNCTION LogGetLogSize(theService: LogID; VAR maxSize: ByteCount): OSStatus; C;
  180. FUNCTION LogSetLogSize(theService: LogID; maxSize: ByteCount): OSStatus; C;
  181. {$ENDC}
  182. {$ENDC}
  183. {$ALIGN RESET}
  184. {$POP}
  185.  
  186. {$SETC UsingIncludes := SystemLoggingIncludes}
  187.  
  188. {$ENDC} {__SYSTEMLOGGING__}
  189.  
  190. {$IFC NOT UsingIncludes}
  191.  END.
  192. {$ENDC}
  193.